/*
 * main.c
 *
 *  Created on: 23 Nov 2010
 *      Author: samuel
 */

#include "stdio.h"
#include "../include/algorithm.h"
#include "../include/list.h"


#define MAX_DATA (1024)


int main(int argc, char **argv)
{
	int tmp;
    int data[MAX_DATA];

    alg_data_generate_positive(data, MAX_DATA, MAX_DATA);
    //alg_data_generate_mixed(data, 10, 10);
    alg_data_print(data, 10);

    //printf("\nMax subsequence sum: %d\n", max_sequence_sum(data, 10));
    //printf("Greatest Common Divisor: %d\n", alg_gcd(1989, 1590));

    List l = MakeList(data, 10);
    PrintList(l);

	printf("\nAfter sort:\n");
    List s = SortList(l);
    PrintList(s);

#if 0
    ArrayPoly poly1 = MakeArrayPoly(4);
    PrintArrayPoly(poly1);

    ArrayPoly poly2 = MakeArrayPoly(4);
    PrintArrayPoly(poly2);

    ArrayPoly sum = AddArrayPoly(poly1, poly2);
    printf("\nsum: ");
    PrintArrayPoly(sum);

    ArrayPoly m = MultiArrayPoly(poly1, poly2);
    printf("\nmul: ");
    PrintArrayPoly(m);

    ListPoly p1 = MakeListPolyFromArrayPoly(poly1);
    PrintListPoly(p1);

    ListPoly p2 = MakeListPolyFromArrayPoly(poly2);
    PrintListPoly(p2);

    ListPoly sum1 = AddListPoly(p1, p2);
    printf("\nsum1: ");
    PrintListPoly(sum1);

	ListPoly mul1 = MultiListPoly(p1, p2);
    printf("\nmul1: ");
    PrintListPoly(mul1);
#endif

	scanf("%d", &tmp);

    return 0;
}

